<template>
    <div>
        <span>
            <RouterLink to="/home">/ 主页</RouterLink>
        </span>
        <span v-for="(item,index) in pathlist ">
             / 
            <RouterLink :to="`${pathlist2[index]}`">{{ valuelist[index] }}</RouterLink>
        </span>
    </div>
</template>
<script setup>
const props = defineProps({
  path: {
    type: String,
    required: true
  },
  value: {
    type: String,
    required: true
  }
})
let path=props.path;
let value=props.value;
let pathlist = path.split("/"); 
let valuelist = value.split("/"); 
let pathlist2 = [];
let p = '';
pathlist.forEach((x,y)=>{
    p = p+"/"+x;
    pathlist2.push(p);
})
</script>
<style scoped>
    span{
        color: #ccc;
        font-size:2rem ;
    }
    div{
        margin-top: 3rem;
        margin-bottom: 4rem;
        padding-left: 3rem;
    }
</style>